home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1988 / Oct⁄Nov 88 / Re- Jumping over ⁄ 11.10.88 ⁄ < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.4 KB  |  38 lines  |  [TEXT/GEOL]

  1. Item    9003552                         10-Nov-88        10:46
  2.  
  3. From:   ROSENSTEIN1                     Rosenstein, Larry
  4.  
  5. To:     D1157                           All Star Computer, Dev, L Goldman
  6.  
  7. cc:     MACAPP.TECH$                    MACAPP Tech
  8.  
  9. Sub:    re Jumping Over Ancestors
  10.  
  11. I agree with Kurt that skipping over ancestors is not a good language feature.
  12. (There is no way to do so in Object Pascal, as he says.)  Skipping over a level
  13. in the class hierarchy violates the integrity of the class being skipped over.
  14. I would argue that if there is a case where you need to skip over a class, then
  15. something is wrong with the class design.
  16.  
  17. This is not the case for TSortedList, however, since you are talking about a
  18. bug in the implementation.  If there is a bug in TSortedList, then it should be
  19. fixed.
  20.  
  21. A technique used in Smalltalk is to define a basic method that performs some
  22. function and that is never overridden.  (For example, I think that Object
  23. defines basicAt: to access the indexed part of an object.)  Then there is a
  24. second method that calls the first, which may be overridden.Subclasses, can
  25. call the basic method to skip over the inherited implementations.  (In this
  26. case at: call basicAt:.)
  27.  
  28. This is a good design technique in general, because it breaks down methods into
  29. their fundamental parts, and provides more flexibility for clients of that
  30. class.
  31.  
  32. Larry Rosenstein
  33.  
  34.  
  35.  
  36.  
  37.  
  38.